/**
 *	The NeuroCoSA Toolkit
 *	Copyright (C) 2003-6 Stuart Meikle.
 *
 *	This is free software; you can redistribute it and/or
 *	modify it under the terms of the GNU Lesser General Public
 *	License as published by the Free Software Foundation; either
 *	version 2.1 of the License, or (at your option) any later version.
 *
 *	This library is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *	Lesser General Public License for more details.
 *
 * @author	Stuart Meikle
 * @version	2006-halloween(mk2)
 * @license	LGPL
 */

package org.stumeikle.NeuroCoSA;
import java.util.*;

import java.awt.*;
import java.awt.event.*;
import java.lang.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.*;
import javax.swing.event.*;
import org.stumeikle.NeuroCoSA.AutoCluster.NScalar;

/** 
 * Probe synapse
 * 
 * A synapse used to relay neuron information to antoher neuron
 * . Also needs to act as a conduit for drive signals.
 * Learn and drive signals need to be propagated. (new version)
 *
 * stumeikle 20070308
 *
 */
public class	ProbeSynapse	extends SimpleSynapse
{
    ProbeVesicle	iOutput;

    public     ProbeSynapse(Neuron p,Neuron n)
    {
        super(p,n);
	setAdaptive(false); /*** v important. Probe synapse connection 
			     * strengths do not indicate correlations 
			     */
	iOutput = new ProbeVesicle();
    }

    /** This must be overloaded by the derived forms:
     */
    public   Vesicle	simplePropagate(Vesicle vp)
    {

	//ignore the incoming vesicle
	//output is set purely by the learn and drive signals in the parent
	//neuron
	if (vp!=null)
	{
	    try
	    { 
		SimpleNeuron	n = (SimpleNeuron)getParent();
		iOutput.setDriveStrength( n.getDriveSigStr() );
		iOutput.setLearnStrength( n.getLearnSigStr() );

	    	return iOutput;
	    } catch(Exception e) {} //cast error
	}

	return null;
    }
}


